<?php
/**
 * 周舟 hzboye010@163.com
 * addby sublime snippets
 * 论坛个人中心 测试类
 */

namespace app\test\controller;

use app\test\controller\Ava;
use app\utils\BoyeService;

class BbsUserCenter extends Ava{
  //取消收藏 - 支持多选
  public function fav(){
    if(IS_AJAX){
      $data = [
        'uid'      => I('post.uid',''),
        'fav_type' => I('post.fav_type',''),
        'ids'      => I('post.ids',''),
        'api_ver'   => $this->api_ver,
        'notify_id' => $this->notify_id,
        'alg'       => $this->alg,
        'type'      => 'BY_BbsUserCenter_fav',
      ];

      $service = new BoyeService();
      $result = $service->callRemote("",$data,true);
      echo $this->parseResult($result);
    }else{
      $this->assign('type','BY_BbsUserCenter_fav');
      $this->assign('field',[
        ['api_ver','100',LL('need-mark api version')],
        ['uid',42,LL('need-mark user ID')],
        ['fav_type','',LL('need-mark fav-no-type')],
        ['ids','',LL('need-mark ids')],
      ]);
      echo $this->display('ava/test');
    }
  }
  //提现记录
  public function walletLog(){
    if(IS_AJAX){
      $data = [
        'uid'       => I('post.uid',''),
        'log_type'  => I('post.log_type',''),
        'page_no'   => I('post.page_no',''),
        'page_size' => I('post.page_size',''),
        'api_ver'   => $this->api_ver,
        'notify_id' => $this->notify_id,
        'alg'       => $this->alg,
        'type'      => 'BY_BbsUserCenter_walletLog',
      ];

      $service = new BoyeService();
      $result = $service->callRemote("",$data,true);
      echo $this->parseResult($result);
    }else{
      $this->assign('type','BY_BbsUserCenter_walletLog');
      $this->assign('field',[
        ['api_ver','100',LL('need-mark api version')],
        ['uid',42,LL('need-mark user ID')],
        ['log_type','',L('wallet-log-type')],
        ['page_no',1,L('page')],
        ['page_size',10,LL('page size')],
      ]);
      echo $this->display('ava/test');
    }
  }
  //申请提现
  public function walletOut(){
    if(IS_AJAX){
      $data = [
        'uid'       => I('post.uid',''),
        'money'     => I('post.money',''),
        'api_ver'   => $this->api_ver,
        'notify_id' => $this->notify_id,
        'alg'       => $this->alg,
        'type'      => 'BY_BbsUserCenter_walletOut',
      ];

      $service = new BoyeService();
      $result  = $service->callRemote("",$data,true);
      echo $this->parseResult($result);
    }else{
      $this->assign('type','BY_BbsUserCenter_walletOut');
      $this->assign('field',[
        ['api_ver','100',LL('need-mark api version')],
        ['uid',50,LL('need-mark user ID')],
        ['money',10,LL('need-mark money')],
      ]);
      echo $this->display('ava/test');
    }
  }
  //我的MMZ商品评价 - 分页
  public function giftComment(){
    if(IS_AJAX){
      $data = [
        'uid'       => I('post.uid',''),
        'max_img'   => I('post.max_img',''),
        // 'c_type'    => I('post.c_type',''),
        'page_no'   => I('post.page_no',''),
        'page_size' => I('post.page_size',''),
        'api_ver'   => $this->api_ver,
        'notify_id' => $this->notify_id,
        'alg'       => $this->alg,
        'type'      => 'BY_BbsUserCenter_giftComment',
      ];

      $service = new BoyeService();
      $result = $service->callRemote("",$data,true);
      echo $this->parseResult($result);
    }else{
      $this->assign('type','BY_BbsUserCenter_giftComment');
      $this->assign('field',[
        ['api_ver','100',LL('need-mark api version')],
        ['uid',143,LL('need-mark user ID')],
        ['max_img',3,LL('max-img')],
        // ['c_type','',L('comment-type')],
        ['page_no',1,L('page')],
        ['page_size',10,L('page size')],
      ]);
      echo $this->display('ava/test');
    }
  }
  //我的商品评价 - 分页
  public function proComment(){
    if(IS_AJAX){
      $data = [
        'uid'       => I('post.uid',''),
        'max_img'   => I('post.max_img',''),
        // 'c_type'    => I('post.c_type',''),
        'page_no'   => I('post.page_no',''),
        'page_size' => I('post.page_size',''),
        'api_ver'   => $this->api_ver,
        'notify_id' => $this->notify_id,
        'alg'       => $this->alg,
        'type'      => 'BY_BbsUserCenter_proComment',
      ];

      $service = new BoyeService();
      $result = $service->callRemote("",$data,true);
      echo $this->parseResult($result);
    }else{
      $this->assign('type','BY_BbsUserCenter_proComment');
      $this->assign('field',[
        ['api_ver','100',LL('need-mark api version')],
        ['uid',143,LL('need-mark user ID')],
        ['max_img',3,LL('max-img')],
        // ['c_type','',L('comment-type')],
        ['page_no',1,L('page')],
        ['page_size',10,L('page size')],
      ]);
      echo $this->display('ava/test');
    }
  }
  //关注列表
  public function myFocus(){
    if(IS_AJAX){
      $data = [
        'uid'       => I('post.uid',''),
        'my_uid'    => I('post.my_uid',''),
        'page_no'   => I('post.page_no',''),
        'page_size' => I('post.page_size',''),
        'api_ver'   => $this->api_ver,
        'notify_id' => $this->notify_id,
        'alg'       => $this->alg,
        'type'      => 'BY_BbsUserCenter_myFocus',
      ];

      $service = new BoyeService();
      $result = $service->callRemote("",$data,true);
      echo $this->parseResult($result);
    }else{
      $this->assign('type','BY_BbsUserCenter_myFocus');
      $this->assign('field',[
        ['api_ver','100',LL('need-mark api version')],
        ['uid',42,LL('need-mark user ID')],
        ['my_uid',50,LL('need-mark look user ID')],
        ['page_no',1,L('page')],
        ['page_size',10,L('page size')],
      ]);
      echo $this->display('ava/test');
    }
  }
  //点赞我的
  public function likeMe(){
    if(IS_AJAX){
      $data = [
        'uid'       => I('post.uid',''),
        'page_no'   => I('post.page_no',''),
        'page_size' => I('post.page_size',''),
        'api_ver'   => $this->api_ver,
        'notify_id' => $this->notify_id,
        'alg'       => $this->alg,
        'type'      => 'BY_BbsUserCenter_likeMe',
      ];

      $service = new BoyeService();
      $result = $service->callRemote("",$data,true);
      echo $this->parseResult($result);
    }else{
      $this->assign('type','BY_BbsUserCenter_likeMe');
      $this->assign('field',[
        ['api_ver','100',LL('need-mark api version')],
        ['uid',143,LL('need-mark user ID')],
        ['page_no',1,L('page')],
        ['page_size',10,L('page size')],
      ]);
      echo $this->display('ava/test');
    }
  }
  //粉丝列表
  public function focusMe(){
    if(IS_AJAX){
      $data = [
        'uid'       => I('post.uid',''),
        'my_uid'    => I('post.my_uid',''),
        'page_no'   => I('post.page_no',''),
        'page_size' => I('post.page_size',''),
        'api_ver'   => $this->api_ver,
        'notify_id' => $this->notify_id,
        'alg'       => $this->alg,
        'type'      => 'BY_BbsUserCenter_focusMe',
      ];

      $service = new BoyeService();
      $result = $service->callRemote("",$data,true);
      echo $this->parseResult($result);
    }else{
      $this->assign('type','BY_BbsUserCenter_focusMe');
      $this->assign('field',[
        ['api_ver','100',LL('need-mark api version')],
        ['uid',42,LL('need-mark user ID')],
        ['my_uid',50,LL('need-mark look user ID')],
        ['page_no',1,L('page')],
        ['page_size',10,L('page size')],
      ]);
      echo $this->display('ava/test');
    }
  }
  //个人信息
  public function getUserInfo(){
    if(IS_AJAX){
      $data = [
        'uid'       => I('post.uid',''),
    		'from_uid'  => I('post.from_uid',''),
    		'api_ver'   => $this->api_ver,
    		'notify_id' => $this->notify_id,
    		'alg'       => $this->alg,
    		'type'      => 'BY_BbsUserCenter_getUserInfo',
      ];

      $service = new BoyeService();
      $result = $service->callRemote("",$data,true);
      echo $this->parseResult($result);
    }else{
      $this->assign('type','BY_BbsUserCenter_getUserInfo');
      $this->assign('field',[
        ['api_ver','100',LL('need-mark api version')],
        ['uid',50,LL('need-mark user ID')],
        ['from_uid',42,LL('which-user-ID-is-from')],
      ]);
      echo $this->display('ava/test');
    }
  }
  //评论我的 - 分页
  public function replyPost(){
      if(IS_AJAX){
          $data = [
  				'uid'       => I('post.uid',''),
  				'page_no'   => I('post.page_no',''),
  				'page_size' => I('post.page_size',''),
  				'api_ver'     => $this->api_ver,
  				'notify_id'   => $this->notify_id,
  				'alg'         => $this->alg,
  				'type'        => 'BY_BbsUserCenter_replyPost',
        ];

        $service = new BoyeService();
        $result = $service->callRemote("",$data,true);
        echo $this->parseResult($result);
      }else{
        $this->assign('type','BY_BbsUserCenter_replyPost');
        $this->assign('field',[
          ['api_ver','100',LL('need-mark api version')],
          ['uid',22,LL('need-mark user ID')],
          ['page_no',1,LL('page')],
          ['page_size',10,LL('page size')],
        ]);
        echo $this->display('ava/test');
      }
  }
  //回复我的 - 分页
  public function replyThread(){
      if(IS_AJAX){
          $data = [
          'uid'       => I('post.uid',''),
          'page_no'   => I('post.page_no',''),
          'page_size' => I('post.page_size',''),
          'img_num'   => I('post.img_num',''),
          'api_ver'   => $this->api_ver,
          'notify_id' => $this->notify_id,
          'alg'       => $this->alg,
          'type'      => 'BY_BbsUserCenter_replyThread',
        ];

        $service = new BoyeService();
        $result = $service->callRemote("",$data,true);
        echo $this->parseResult($result);
      }else{
        $this->assign('type','BY_BbsUserCenter_replyThread');
        $this->assign('field',[
          ['api_ver','100',LL('need-mark api version')],
          ['uid',22,LL('need-mark user ID')],
          ['page_no',1,LL('page')],
          ['page_size',10,LL('page size')],
          ['img_num',3,L('img-num')],
        ]);
        echo $this->display('ava/test');
      }
  }
  //我的评论 - 分页
  public function queryComment(){
      if(IS_AJAX){
          $data = [
  				'uid'       => I('post.uid',''),
  				'page_no'   => I('post.page_no',''),
  				'page_size' => I('post.page_size',''),
  				'api_ver'     => $this->api_ver,
  				'notify_id'   => $this->notify_id,
  				'alg'         => $this->alg,
  				'type'        => 'BY_BbsUserCenter_queryComment',
        ];

        $service = new BoyeService();
        $result = $service->callRemote("",$data,true);
        echo $this->parseResult($result);
      }else{
        $this->assign('type','BY_BbsUserCenter_queryComment');
        $this->assign('field',[
          ['api_ver','100',LL('need-mark api version')],
          ['uid',22,LL('need-mark user ID')],
          ['page_no',1,LL('page')],
          ['page_size',10,LL('page size')],
        ]);
        echo $this->display('ava/test');
      }
  }
  //我的回复 - 分页
  public function queryPost(){
      if(IS_AJAX){
          $data = [
  				'uid'       => I('post.uid',''),
  				'img_num'   => I('post.img_num',''),
  				'page_no'   => I('post.page_no',''),
  				'page_size' => I('post.page_size',''),
  				'api_ver'     => $this->api_ver,
  				'notify_id'   => $this->notify_id,
  				'alg'         => $this->alg,
  				'type'        => 'BY_BbsUserCenter_queryPost',
        ];

        $service = new BoyeService();
        $result = $service->callRemote("",$data,true);
        echo $this->parseResult($result);
      }else{
        $this->assign('type','BY_BbsUserCenter_queryPost');
        $this->assign('field',[
          ['api_ver','100',LL('need-mark api version')],
          ['uid',22,LL('need-mark user ID')],
          ['img_num',3,L('img-num')],
          ['page_no',1,LL('page')],
          ['page_size',10,LL('page size')],
        ]);
        echo $this->display('ava/test');
      }
  }
  //我的帖子 - 分页
  public function queryThread(){
      if(IS_AJAX){
          $data = [
          'uid'       => I('post.uid',''),
          'fid'       => I('post.fid',''),
          'img_num'   => I('post.img_num',''),
          'page_no'   => I('post.page_no',''),
          'page_size' => I('post.page_size',''),
          'max_like'    =>I('post.max_like',''),
          'max_reply'   =>I('post.max_reply',''),
          'max_comment' =>I('post.max_comment',''),
          'api_ver'   => $this->api_ver,
          'notify_id' => $this->notify_id,
          'alg'       => $this->alg,
          'type'      => 'BY_BbsUserCenter_queryThread',
        ];

        $service = new BoyeService();
        $result = $service->callRemote("",$data,true);
        return $this->parseResult($result);
      }else{
        $this->assign('logs',true);
        $this->assign('type','BY_BbsUserCenter_queryThread');
        $this->assign('field',[
          ['api_ver','100',LL('need-mark api version')],
          ['uid',50,LL('need-mark user ID')],
          ['fid','',LL('forum block ID')],
          ['img_num',3,L('img-num')],
          ['page_no',1,LL('page')],
          ['page_size',10,LL('page size')],
          ['max_like',10,LL('max like count')],
          ['max_reply',3,LL('max post count')],
          ['max_comment',2,LL('max comment count')],
        ]);
        echo $this->display('ava/test');
      }
  }

}